/***********************************************************************//**
 *   \file FFT.h		\author belot nicolas (karrakis)           
 *   \brief define FFT
 *    a class for Handling FFT		                                   *
 ************************************************************************//*
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef FFT_H
#define FFT_H 1
#include "libtrckr.h"
#include "DFT.h"
#include "Buffer.h"
namespace libtrckr {
class FFT {
	/** \class libtrckr::FFT
	\brief Allow to create DFT and the inverse...
	*/
	public:
	/** Default Constructor */
	FFT( );
	/** Constructor
	\param size the size of the DFT
	*/
	FFT(unsigned int);
	/** Copy constructor */
	FFT(const FFT&);

	/**Destructor */
	~FFT();

	/** Accessor, copie the date in the Input part of the FFT
	*/
	void setIn(double *); 
	/** \overload void FFT::SetIn(const DFT &)	*/
	void setIn(const DFT &);
	/** \overload void FFT::SetIn(fftw_complex *) */
	void setIn(fftw_complex *);
	/** \overload void FFT::Setin(const Buffer&) */
	void setIn(const Buffer&);
	/** Calculate the DFT
	\return the calculated DFT
	*/
	DFT execute();
	/**Calculate the Inverse DFT
	\return the inverse...
	*/
	DFT inverse();
	/** Get the size of the FFT*/
	unsigned int Size() const;
	/** Set the size of the FFT*/
	void Size(unsigned int);
		
	/** operator= */
	FFT& operator = (const FFT &);

	private:
	unsigned int size;
	fftw_complex* in;
	fftw_complex* out;
	fftw_plan forward;
	fftw_plan backward;

};
}
#endif

